using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Web;

namespace EncodeTool
{
    public partial class formEncodeTool : Form
    {
        public formEncodeTool()
        {
            InitializeComponent();
        }

        private void btnEncode_Click(object sender, EventArgs e)
        {
            txtURLEncodeUTF8Result.Text = HttpUtility.UrlEncode(txt1.Text, Encoding.UTF8);
            txtURLEncodeGBKResult.Text = HttpUtility.UrlEncode(txt1.Text, Encoding.GetEncoding("GBK"));
        }

        private void btnURLDecode_Click(object sender, EventArgs e)
        {
            txtURLDecodeUTF8Result.Text = HttpUtility.UrlDecode(txt2.Text, Encoding.UTF8);
            txtURLDecodeGBKResult.Text = HttpUtility.UrlDecode(txt2.Text, Encoding.GetEncoding("GBK"));
        }

    }
}